package com.xxy.springcloud.controller;

import com.xxy.springcloud.entities.CommonResult;
import com.xxy.springcloud.entities.Payment;
import com.xxy.springcloud.feign.Feign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/consumer")
public class OrderController {

    @Autowired
    Feign feign;

    @PostMapping(value = "/payment/create")
    public CommonResult<Payment> create(@RequestParam String serial){

        return feign.create(serial);
    }

    @GetMapping("payment/get/{id}")
    private CommonResult<Payment> getPayment(@PathVariable Long id) {
        return feign.getPaymentById(id);
    }
}

